<?php
/**
 * Created by PhpStorm.
 * User: helloxingtongshi
 * Date: 2016-05-19
 * Time: 9:15
 *
 */
include ("navigationtopinfo.php")?>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="CSS/style.css" rel="stylesheet">
    <script src="jquery.js" ></script>
    <script >
        function testm() {
            document.getElementById('materialname').submit();//提交form表单select框内的数据，方便sql获取post
            var material=document.getElementById('selectm').value;
            var num=document.getElementById("num").value ;
            document.getElementById("num").value = num;


        }
        function testp() {
            document.getElementById('producename').submit();
            var producename=document.getElementById('selectp').value;
            var num=document.getElementById("pnum").value ;
            document.getElementById("pnum").value = num;
        }
    </script>
    <style>
        body{margin:0; padding:0;text-align:center;}
        #tit a{
            color:#F00;
            list-style:none;
            text-decoration:none;
        }
    </style>
</head>
<body background="../../money/pic/topbg.jpg">
    <div align="center">
        <h3>进销存管理系统<h3>
    </div>
    <div id="tit" align="right">
    <a href="index.php" target="_top">退出登录&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
    </div>
    <table align="top" width="52%">
        <tr>
            <th>库存量查询：</th>
            <form action="navigationtop.php" method="post" name="materialname" id="materialname">
            <td><select name="materialname" id="selectm" onchange="testm()"  >
                    <option>--请选择材料--</option>
                    <?php foreach($nmaterial as $value2) { ?>
                        <option value="<?php echo $value2[1] ?>" <?php if(@$_POST['materialname']==$value2[1])  echo  "selected" ?>>
                            <?php echo $value2[1] ?>
                        </option>
                    <?php } ?>
                </select>
            </td>
            <td>
                <input type="text" size="15" id="num" name="num" value="<?php echo $valueb-$valuec ?>">
            </td>
            </form>
            <form action="navigationtop.php" method="post" name="producename" id="producename">
            <td><select name="producename" id="selectp" onchange="testp()" >
                    <option>--请选择商品--</option>
                    <?php foreach($nproduce as $value3) { ?>
                        <option value="<?php echo $value3[1] ?>" <?php if(@$_POST['producename']==$value3[1])  echo  "selected" ?>>
                            <?php echo $value3[1] ?>
                        </option>
                    <?php } ?>
                </select>
            </td>
            <td><input type="text" size="15" value="<?php echo $valued-$valuee ?>"id="pnum" name="pnum"></td>
            </form>
        </tr>

    </table>


</body>
</html>
